package com.cpit.platform.dto;

import com.cpit.platform.common.excel.annotation.ExcelField;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.util.Date;

/**
 * 操作日志
 *
 * @author Yanyongqing
 * @since 2018/3/20.
 */
@Entity
public class OperLog extends BaseEntity {
    public static final String ENTITY_DISPLAY_NAME = "操作日志";

    @ExcelField(title = "操作时间", align = 2, sort = 1)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date operateTime;

    @ExcelField(title = "操作人员", align = 2, sort = 2)
    @Column(nullable = false, length = 120)
    private String operateUser;

    @ExcelField(title = "操作模块", align = 2, sort = 3)
    private String moduleName;

    @Column(nullable = true)
    private String module;

    @ExcelField(title = "操作项", align = 2, sort = 4)
    private String commandName;

    @Column(nullable = false, length = 255)
    private String command;

    @ExcelField(title = "操作结果", align = 2, sort = 5)
    private String resultName;

    @Column(nullable = false)
    private String result;

    @ExcelField(title = "详细信息", align = 2, sort = 6)
    @Column(nullable = true, length = 255)
    private String detail;

    @Column(nullable = true, length = 50)
    private String hostIp;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @Column(nullable = true)
    private Integer system;

    public Date getOperateTime() {
        return operateTime;
    }

    public void setOperateTime(Date operateTime) {
        this.operateTime = operateTime;
    }

    public String getOperateUser() {
        return operateUser;
    }

    public void setOperateUser(String operateUser) {
        this.operateUser = operateUser;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getCommandName() {
        return commandName;
    }

    public void setCommandName(String commandName) {
        this.commandName = commandName;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public String getResultName() {
        return resultName;
    }

    public void setResultName(String resultName) {
        this.resultName = resultName;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getHostIp() {
        return hostIp;
    }

    public void setHostIp(String hostIp) {
        this.hostIp = hostIp;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }


    public Integer getSystem() {
        return system;
    }

    public void setSystem(Integer system) {
        this.system = system;
    }

    @Override
    public String toString() {
        return "OperLog{" +
                "operateTime=" + operateTime +
                ", operateUser='" + operateUser + '\'' +
                ", moduleName='" + moduleName + '\'' +
                ", module='" + module + '\'' +
                ", commandName='" + commandName + '\'' +
                ", command='" + command + '\'' +
                ", resultName='" + resultName + '\'' +
                ", result='" + result + '\'' +
                ", detail='" + detail + '\'' +
                ", hostIp='" + hostIp + '\'' +
                ", endTime=" + endTime +
                ", system=" + system +
                '}';
    }
}
